import { request } from '@ruifox-cms/utils'

// 获取所有组件列表
export function getComponentList(params) {
    return request({
        url: '/formDesign/getComponentList',
        method: 'get',
        params
    })
}
// 获取当前可用题型
export function getCurComponentList(params) {
    return request({
        url: '/formDesign/getCurComponentList',
        method: 'get',
        params
    })
}
// 获取题库（我的题库）
export function getMyBank(params) {
    return request({
        url: '/formDesign/getMyBank',
        method: 'get',
        params
    })
}
// 获取题库（公共题库）
export function getPublicBank(params) {
    return request({
        url: '/formDesign/getPublicBank',
        method: 'get',
        params
    })
}
// 添加分组（我的题库）
export function addMyBank(data) {
    return request({
        url: '/formDesign/addMyBank',
        method: 'post',
        data
    })
}
// 修改分组（我的题库）
export function editMyBank(data) {
    return request({
        url: '/formDesign/editMyBank',
        method: 'post',
        data
    })
}
// 删除分组（我的题库）
export function deleteMyBankByIds(data) {
    return request({
        url: '/formDesign/deleteMyBankByIds',
        method: 'delete',
        data
    })
}
// 添加题目（我的题库）
export function addMyBankQs(data) {
    return request({
        url: '/formDesign/addMyBankQs',
        method: 'post',
        data
    })
}
// 修改题目（我的题库）
export function editMyBankQs(data) {
    return request({
        url: '/formDesign/editMyBankQs',
        method: 'post',
        data
    })
}
// 修改题目（我的题库）
export function deleteMyBankQsByIds(data) {
    return request({
        url: '/formDesign/deleteMyBankQsByIds',
        method: 'delete',
        data
    })
}
// 推荐外观
export function getRecommendAppearance(params) {
    return request({
        url: '/formDesign/getRecommendAppearance',
        method: 'get',
        params
    })
}
// 我的外观
export function getMyAppearance(params) {
    return request({
        url: '/formDesign/getMyAppearance',
        method: 'get',
        params
    })
}
// 保存我的外观
export function saveMyAppearance(data) {
    return request({
        url: '/formDesign/saveMyAppearance',
        method: 'post',
        data
    })
}
// 获取推荐页眉图片
export function getRecommendHeaderImg(params) {
    return request({
        url: '/formDesign/getRecommendHeaderImg',
        method: 'get',
        params
    })
}
// 获取推荐背景图片
export function getRecommendBackImg(params) {
    return request({
        url: '/formDesign/getRecommendBackImg',
        method: 'get',
        params
    })
}
// 获取登陆地址
export function getLoginAddress(params) {
    return request({
        url: '/formDesign/getLoginAddress',
        method: 'get',
        params
    })
}
// 获取指定角色列表
export function getRoleLists(params) {
    return request({
        url: '/formDesign/getRoleLists',
        method: 'get',
        params
    })
}
// 获取IP段白名单
export function getIpWhiteList(params) {
    return request({
        url: '/formDesign/getIpWhiteList',
        method: 'get',
        params
    })
}
//获取访问权限验证列表
export function getPermissionList(params) {
    return request({
        url: '/formDesign/getPermissionList',
        method: 'get',
        params
    })
}
// 获取问卷类型列表
export function getFormTypeList(params) {
    return request({
        url: '/formManage/getFormTypeList',
        method: 'get',
        params
    })
}
// 获取问卷管理列表
export function getFormManageList(params) {
    return request({
        url: '/formManage/getFormManageList',
        method: 'get',
        params
    })
}
// 获取表单统计
export function getFormStatistics(params) {
    return request({
        url: '/formManage/getFormStatistics',
        method: 'get',
        params
    })
}
// 获取分析统计（表格形式）
export function getFormAnalysisData(params) {
  return request({
      url: '/formManage/getFormAnalysisData',
      method: 'get',
      params
  })
}
// 表单发布
export function formPublish(data) {
    return request({
        url: '/formSystem/formPublish',
        method: 'post',
        data
    })
}
// 表单编辑
export function formEdit(data) {
    return request({
        url: '/formSystem/formEdit',
        method: 'post',
        data
    })
}
// 表单删除
export function formDelete(data) {
    return request({
        url: '/formSystem/formDelete',
        method: 'delete',
        data
    })
}
// 获取当前表单模板信息
export function getCurFormInfo(params) {
    return request({
        url: '/formManage/getCurFormInfo',
        method: 'get',
        params
    })
}
// 获取表单答卷详情
export function getAnswerDetail(params) {
    return request({
        url: '/formManage/getAnswerDetail',
        method: 'get',
        params
    })
}
// 获取表单答卷详情
export function deleteAnswerByIds(data) {
    return request({
        url: '/formManage/deleteAnswerByIds',
        method: 'delete',
        data
    })
}
// 获取表单分享基本信息（标题、二维码、链接）
export function getShareInfo(params) {
    return request({
        url: '/formShare/getShareInfo',
        method: 'get',
        params
    })
}
// 获取自定义来源
export function getCustomSource(params) {
    return request({
        url: '/formShare/getCustomSource',
        method: 'get',
        params
    })
}
// 获取来源随机链接
export function getRandomLink(params) {
    return request({
        url: '/formShare/getRandomLink',
        method: 'get',
        params
    })
}
// 添加自定义来源
export function addCustomSource(data) {
    return request({
        url: '/formShare/addCustomSource',
        method: 'post',
        data
    })
}
// 更新自定义来源
export function updateCustomSource(data) {
    return request({
        url: '/formShare/updateCustomSource',
        method: 'post',
        data
    })
}
// 删除自定义来源
export function deleteCustomSource(params) {
    return request({
        url: '/formShare/deleteCustomSource',
        method: 'post',
        params
    })
}
// 审核答卷
export function answerAudit(data) {
    return request({
        url: '/formManage/answerAudit',
        method: 'post',
        data
    })
}
// 答卷打分
export function answerRate(data) {
    return request({
        url: '/formManage/answerRate',
        method: 'post',
        data
    })
}
// 表单设置更新
export function updatePublishSetting(data) {
    return request({
        url: '/formShare/updatePublishSetting',
        method: 'post',
        data
    })
}
// 获取预定义选项 
export function getPresupposeOption(params) {
    return request({
        url: '/formSystem/getPresupposeOption',
        method: 'get',
        params
    })
}
// 获取操作记录
export function getFormOperationLog(params) {
    return request({
        url: '/formSystem/getFormOperationLog',
        method: 'get',
        params
    })
}
// 修改表单状态
export function changeFormStatus(data) {
    return request({
        url: '/formSystem/changeFormStatus',
        method: 'post',
        data
    })
}
// 表单收藏
export function formCollect(data) {
    return request({
        url: '/formSystem/formCollect',
        method: 'post',
        data
    })
}
// 清空数据
export function clearFormStatistics(data) {
    return request({
        url: '/formSystem/clearFormStatistics',
        method: 'delete',
        data
    })
}
// 我的问卷发布量
export function myQsStatistics() {
    return request({
        url: '/formSystem/myQsStatistics',
        method: 'get',
    })
}
// 暂存
export function formStaging(data) {
    return request({
        url: '/formSystem/formStaging',
        method: 'post',
        data
    })
}
// 回收站恢复
export function formRestore(data) {
    return request({
        url: '/formSystem/formRestore',
        method: 'post',
        data
    })
}
// 回收站删除
export function recycleDelete(data) {
    return request({
        url: '/formSystem/recycleDelete',
        method: 'delete',
        data
    })
}
